package sbeam.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import sbeam.mapper.LibraryMapper;
import sbeam.model.Library;
import sbeam.model.PalyGame;
import sbeam.service.LibraryService;

@Service
public class LibraryServiceImpl implements LibraryService {
	
	@Autowired
	private LibraryMapper dao;

	@Override
	public void addPalyGame(Integer userId, Integer gid) {
		this.dao.addPalyGame(userId,gid);
		
	}

	@Override
	public Library isRepeat(Integer userId, Integer gid, String type) {
		if(type.equals("paly")) {
			return this.dao.palyIsRepeat(userId,gid);
		}else{
			return this.dao.salesIsRepeat(userId,gid);
		}
	}

	@Override
	public List<Library> findPalyGameByUserId(Integer userId) {
		return this.dao.findPalyGameByUserId(userId);
	}
	
	
}
